﻿<UserControl x:Class="PHPVHReportViewer.Views.StaticAnalysisResultsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:views="clr-namespace:PHPVHReportViewer.Views">
    <Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="9" MaxWidth="500"  Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Border Grid.Row="1" Style="{StaticResource BorderStyle}">
            <ListBox Grid.Row="1" x:Name="ItemListBox2" Background="Transparent"
                                 ItemsSource="{Binding StaticAnalysisAlerts}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Margin="2,2,4,2"  Text="{Binding Alert.Name}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Border>

        <Border Grid.Column="1" Grid.Row="1" Style="{StaticResource BorderStyle}">
            <Grid DataContext="{Binding ElementName=ItemListBox2,Path=SelectedItem}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0"  Text="Alert Name" FontWeight="Bold" />
                <TextBox Grid.Row="1" Text="{Binding Alert.Name,Mode=OneWay}" Margin="0,0,0,4" 
                                                     VerticalAlignment="Center"
                                                     Background="Transparent" />

                <TextBlock Grid.Row="2"  Text="File" FontWeight="Bold" />
                <TextBox Grid.Row="3" Text="{Binding Filename,Mode=OneWay}" Margin="0,0,0,4" 
                                                     VerticalAlignment="Center"
                                                     Background="Transparent" />

                <TextBlock Grid.Row="4"  Text="Line" FontWeight="Bold" />
                <TextBox Grid.Row="5" Text="{Binding Alert.Line,Mode=OneWay}" Margin="0,0,0,4" 
                                                     VerticalAlignment="Center"
                                                     Background="Transparent" />

                <TextBlock Grid.Row="6"  Text="Code Excerpt" FontWeight="Bold" />
                <TextBox Grid.Row="7" Text="{Binding Alert.CodeExcerpt,Mode=OneWay}"
                                     FontFamily="Lucida Console" FontSize="11"
                                     Background="Transparent"
                                     VerticalScrollBarVisibility="Auto"
                                     HorizontalScrollBarVisibility="Auto"/>


            </Grid>

        </Border>

        <GridSplitter Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" Width="4"
                                          Background="Transparent" Margin="-2,0,0,0"
                                          HorizontalAlignment="Left"/>
    </Grid>
</UserControl>
